<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/connopen.asp"-->
<!--#include file="lib/asp-common-lib.asp"-->
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>报关单登记系统</title>
<link rel="stylesheet" type="text/css" href="lib/jqcloud/jqcloud.css" />
<!--#include file="lib/plugins.asp"-->
<script type="text/javascript" src="lib/jqcloud/jqcloud-1.0.3.js"></script>
<style type="text/css">
  .ui-datepicker table {
    border: 0;
  }
  .ui-autocomplete-loading { 
    background: white url('images/ui-anim_basic_16x16.gif') left center no-repeat; 
  }
  .ui-autocomplete,.ui-menu-item .ui-corner-all {
      border-radius: 0;
  }
  thead th{
    text-align:center;
    background:#e0e0e0;
  }
  tbody th[scope="row"],tbody th.sub{
    text-align:center;
  }
  input,select{
    border:1px solid #888888;
  }
  input:hover,input:active,select:hover,select:active{
    border:1px solid #aa6666
  }
  input[type=text]{
    padding:2px;
    margin:1px 0;
  }
  #pagebar{
    float:right;
  }
  #search_bar{
    border-width:1px 0;
  }
  #search_bar td{
    padding:1px;
    border-width:0;
  }
  #search_bar tr:hover td{
    background:#fff;
  }
  .bt_button{
    cursor: pointer;
    overflow: visible;
    width: auto;
    background: url("lib/yaml/screen/images/button_gray.png") repeat-x scroll left top #454545;
    border-color: #DDDDDD #444444 #444444 #DDDDDD;
    border-style: solid;
    border-width: 1px;
    color: #000000;
    padding: 5px 1em;
  }
  .bt_button:hover,.bt_button:active,.bt_button:focus{
    background: none repeat-x scroll left top #555555;
    border-color: #444444 #DDDDDD #DDDDDD #444444;
    color: #ffffff;
  }
  #page_go,#print_search,.bt_act{
    padding:0;
  }
  .chk{
    background-color:#d0d0d0;
  }
  #diaglog_print{
    display:none;
    padding:0;
  }
  #lb_search{
    width:5.1em;
  }
  #bts_search{
    width:11.9em;
    text-align:right;
  }
  #adv_search{
    display:none;
  }
  #adv_search select{
    margin:1px 0;
  }
/* Tag cloud */
  
    #tags {  
      text-align:center; 
      padding:10px 0;  
      margin:5px 0;
      overflow:auto; 
    }  
    #tags ul { margin:0; padding:0; }  
    #tags ul li {  
      list-style-type:none; float:left; margin:-1px 10px; 
    }  
    #tags ul li a { text-decoration:none;  line-height:1.1em;}  
    #tags ul li a:hover { text-decoration:none; border:1px solid #aa6666}  
/* // Tag cloud */

/* select class */

    .sel{
      color:red;
    }
    .unsel{
      color:black;
    }
  
/* // select class */

.hlist {
background: transparent;
border: 0 none;
}
.hlist ul {
margin-left: 0;
border: 0 none;
width: 100%;
}
.hlist ul li {
line-height: 1.7em;
display: block;
width: 9.5em;
border: 0;
padding: 0;
}
.hlist ul li input{
margin-right: 0.5em;
}
.tbl_print{
margin-bottom: 0;
border-top: 0;
border-bottom: 0;
}
.tbl_print thead th{
    text-align:left;
    background:transparent;
}
#fm_print {
background: transparent;
border: 0;
margin: 0;
padding: 0;
}
</style>

<script type="text/javascript">
  $(function() {
    $.ajaxSetup ({
      cache: false, //关闭AJAX相应的缓存
      beforeSend:function() {
        $("#search_bar .ui-widget").addClass( "ui-autocomplete-loading" );
        $("#bt_search").attr("disabled",true);
      },
      complete:function() {
        $("#search_bar .ui-widget").removeClass( "ui-autocomplete-loading" );
        $("#bt_search").attr("disabled",false);
      }
    });

    function post_to_url(path, params, method) {
        method = method || "post"; // Set method to post by default if not specified.

        // The rest of this code assumes you are not using a library.
        // It can be made less wordy if you use one.
        var form = document.createElement("form");
        form.setAttribute("method", method);
        form.setAttribute("action", path);
        form.setAttribute("target", "_blank");

        for(var key in params) {
            //console.log(key);
            if(params.hasOwnProperty(key)) {
                var hiddenField = document.createElement("input");
                hiddenField.setAttribute("type", "hidden");
                //hiddenField.setAttribute("name", key);
                hiddenField.setAttribute("name", params[key].name);
                //hiddenField.setAttribute("value", params[key]);
                hiddenField.setAttribute("value", params[key].value);

                form.appendChild(hiddenField);
             }
        }

        document.body.appendChild(form);
        form.submit();
    }    
    
    
    $(".datepicker").datepicker();
    $( "#diaglog_print" ).dialog({
      autoOpen: false,
      width:700,
      modal: true,
      //position: 'center',
      buttons: {
        "导出": function() {
          //window.open('search_print.asp?export=xls&'+$("#fm_search").serialize()+'&'+$("#fm_print").serialize(), '_blank', 'height=768px, width=1024px, scrollbars=yes, resizable=yes');
          // 改用 post 方式
            var post_print_param=$("#fm_print").serializeArray();
            post_print_param=post_print_param.concat($("#fm_search").serializeArray());
            post_print_param.push({name:'export',value:'xls'});
            //console.log(post_print_param);
            post_to_url('search_print.asp',post_print_param);
          },
        "打印": function() {
          //window.open('search_print.asp?'+$("#fm_search").serialize()+'&'+$("#fm_print").serialize(), '_blank', 'height=768px, width=1024px, scrollbars=yes, resizable=yes');
          // 改用 post 方式
            var post_print_param=$("#fm_print").serializeArray();
            post_print_param=post_print_param.concat($("#fm_search").serializeArray());
            post_to_url('search_print.asp',post_print_param);
            //console.log(post_print_param);
            /*--
            $.post('search_print.asp',post_print_param,function(data){
                var win=window.open('about:blank');
                win.document.write(data);
                //with(win.document){
                //    open();
                //    write(data);
                //    close();
                //}
            });
            --*/


        },
        "取消": function() {
          $(this).dialog( "close" );
        }

      }

    });
    $("#print_search").live('click',function(){
      $( "#diaglog_print" ).dialog("open");
    });
    var p=1;
    function vi(p){
      // $.get("search_main.asp?page="+p+"&"+$("#fm_search").serialize(),function(data){//用ajax的get方式提交
      // get 改为 post
      // 防止url过长
      var post_param=$("#fm_search").serializeArray();
      post_param.push({name:'page',value:p});
      $.post("search_main.asp",post_param,function(data){//用ajax的get方式提交
        $("#search_main").html(data);

        $("#pagebar a").click(function(e){//对分页栏中的a元素进行操作
          e.preventDefault();//阻止a的原先事件
          vi($(this).attr("id"));//根据获取的页码值调用显示页面函数
        });
        $("#page_go").click(function(e){//对分页栏中的input元素进行操作
          e.preventDefault();
          if (isNaN($("#page_val").val())||$.trim($("#page_val").val())==""){//判断输入的是否是数字
            alert("输入的页码错误，请输入正确页码！");
            $("#page_val").select();
            return false;//页码值不是数字则退出；
          }
          vi($("#page_val").val());
        });
        /*
        在1024分辨率下显示的内容过长造成企业名称被挤压到多行显示，判断行高度，高于一定值就强行把船名航次换行输出
        */
        var voyage=$(".voyage");
        //console.log(voyage.height());
        if(voyage.height()>40){
            voyage.each(function(index){
                $(this).html($(this).text().split("/")[0]+"<br />/"+$(this).text().split("/")[1]);
            });
        }
        
        var chk=$(".checkid");
        $("#checkall").click(function(){
          chk.prop("checked",$(this).prop("checked"));//根据全选的checkbox状态来填充单个checkbox状态
          $(this).prop("checked") ? chk.closest("tr").addClass("chk") : chk.closest("tr").removeClass("chk")//判断是否全部选中，选中则增加chk样式，没选中则删除chk样式，不能用toggleClass方法，由于下面单个checkbox会改变全选的checkbox状态
        });
        chk.click(function(){
          if(!$(this).prop("checked")) $("#checkall").prop("checked",false);//如果当前checkbox状态为未选中则全选的checkbox也设置为未选中
          $(this).closest("tr").toggleClass("chk");//单个切换当前checkbox存在的tr的chk样式
        });
        
        $(".bt_act").click(function(){
          $chks=$("#search_main input:checkbox.checkid:checked");
          if(confirm("要对这 "+$chks.length+" 条记录做"+$(this).val()+"操作吗？")){
            var aChk=new Array();
            $chks.each(function(){
              aChk.push($(this).val());
            });
            $.post("batch.asp",{chks:aChk.join(),act:$(this).val(),selwtr:$("#selwtr").val()},function(data){
              if(data.bStatus){
                vi($("#page_val").val());
              }else{
                alert(data.sInfo);
              }
            },"json");
          }
        });
        
      });

    }
    
    $("#cd_status").change(function(){
      if($(this).val()==3||$(this).val()==2){
        $("#ytksrq").removeAttr("disabled");
        $("#ytjsrq").removeAttr("disabled");
      }else{
        $("#ytksrq").attr("disabled",true).val("");
        $("#ytjsrq").attr("disabled",true).val("");
      }
    });
    $("#bt_search").click(function(){
      var start_time = new Date().getTime();
      vi(p);
      var end_time = new Date().getTime();
      $("#show_runtime").html(end_time-start_time);
    });
    $("#show_adv").click(function(){
      $("#adv_search").toggle();
    });
    
    //搜索条选择框筛选高亮显示
    /*
    //chrome 不支持 option的click事件
    $("#search_bar select option").click(function(){
      if($(this).index()>0){
        $(this).removeClass("unsel")
          .siblings().addClass("unsel")
          .parent().addClass("sel");
      }else{
        $(this).parent().removeClass("sel")
          .children().removeClass("unsel");
      }
    });
    */
    $("#search_bar input[type=reset]").click(function(){
      $("#search_bar select").removeClass("sel")
        .children().removeClass("unsel");
    });
    
    $("#search_bar select").change(function(){
      //console.log($(this).find("option:selected").index());
      $sel=$(this).find("option:selected");
      if($sel.index()>0){
        $sel.removeClass("unsel")
          .siblings().addClass("unsel")
          .parent().addClass("sel");
      }else{
        $sel.parent().removeClass("sel")
          .children().removeClass("unsel");
      }
    });
    //搜索条选择框筛选高亮显示
    
    
    // tag cloud
    
    $.getJSON("json_tagcloud.asp",function(data){
      if(data.tags==""){return 0;}
      function fColorRdm(){
        return Math.floor(Math.random()*220);
      }
      function randomColor() {
        var rand = Math.floor(Math.random() * 0xFFFFFF).toString(16);
        for (;rand.length < 6;) {
          rand = '0' + rand;
        }
        return '#' + rand;
      }      
      
      function fColor(){
        //return "#"+fColorRdm().toString(16)+fColorRdm().toString(16)+fColorRdm().toString(16);
        var str = "0123456789abcdef";
        var t = "#";
        for(var j=0;j<6;j++){
          t = t + str.charAt(Math.random()*str.length);
        }
        return t;
      }
    
      function fMinFreq(tags){
        var iMin,iMax;
        iMin=iMax=tags[0].freq;
        $.each(tags, function(i, item) {
          if(iMin>item.freq){
            iMin=item.freq;
          }
          if(iMax<item.freq){
            iMax=item.freq;
          }
        });
        return new Array(iMin,iMax);
      }
      
      iMinFreq=fMinFreq(data.tags)[0];
      iMaxFreq=fMinFreq(data.tags)[1];
      
      //create list for tag links
      $("<ul>").appendTo("#tags");
      //create tags
      $.each(data.tags, function(i, val) {
        
        //create item
        var li = $("<li>");

        //regex = new RegExp("有限公司");
        
        tag=val.tag;
        tag=tag.replace(/股份有限公司/g, "");
        tag=tag.replace(/集团有限公司/g, "");
        tag=tag.replace(/有限公司/g, "");
        tag=tag.replace(/宁波市/g, "");
        tag=tag.replace(/（宁波）/g, "");
        tag=tag.replace(/\(宁波\)/g, "");
        tag=tag.replace(/宁波/g, "");
        tag=tag.replace(/台州市/g, "");
        tag=tag.replace(/台州/g, "");
        tag=tag.replace(/温州市/g, "");
        tag=tag.replace(/温州/g, "");
        tag=tag.replace(/鄞州区/g, "");
        tag=tag.replace(/鄞州/g, "");
        tag=tag.replace(/浙江省/g, "");
        tag=tag.replace(/浙江/g, "");
        
        
        //create link
        $("<a>").text(tag)
                .attr({title:"共 " + val.freq + " 单", href: val.tag })
                .css({"font-size": Math.log( val.freq ) / Math.log( iMinFreq ) + "em" , "color" : randomColor()})
                .tooltip()
                .appendTo(li);
        
        
        
        
        //add to list
        li.appendTo("#tags>ul");
        //li.children().css("fontSize", (val.freq / 10 < 1) ? val.freq / 10 + 1 + "em" : val.freq / 10 + "em");
        //li.children().css({"font-size": Math.log( val.freq ) / Math.log( iMinFreq ) + "em","color":fColor()});
      });
    });
    
    $("#tags ul li a").live("click",function(e){
      e.preventDefault();
      //alert($(this).html());
      $("#tx_search").val($(this).attr("href"));
      $("#bt_search").trigger("click");
    });
    
    // tag cloud

     var word_array = [
          {text: "Lorem", weight: 15},
          {text: "Ipsum", weight: 9, link: "http://jquery.com/"},
          {text: "Dolor", weight: 6, html: {title: "I can haz any html attribute"}},
          {text: "Sit", weight: 7},
          {text: "Amet", weight: 5}
          // ...as many words as you want
      ];
      
    $.getJSON("json_jqcloud.asp",function(data){
        if(data.tags==""){return 0;}
        else{
            var word_array = new Array;
            $.each(data.tags, function(i, val) {
                var tagcloud=new Object();
                var tag=val.tag;
                tag=tag.replace(/股份有限公司/g, "");
                tag=tag.replace(/集团有限公司/g, "");
                tag=tag.replace(/有限公司/g, "");
                tag=tag.replace(/宁波市/g, "");
                tag=tag.replace(/（宁波）/g, "");
                tag=tag.replace(/\(宁波\)/g, "");
                tag=tag.replace(/宁波/g, "");
                tag=tag.replace(/台州市/g, "");
                tag=tag.replace(/台州/g, "");
                tag=tag.replace(/温州市/g, "");
                tag=tag.replace(/温州/g, "");
                tag=tag.replace(/鄞州区/g, "");
                tag=tag.replace(/鄞州/g, "");
                tag=tag.replace(/浙江省/g, "");
                tag=tag.replace(/浙江/g, "");
                tagcloud.text=tag;
                tagcloud.weight=val.freq;
                word_array.push(tagcloud);
            });

        }

        $("#example").jQCloud(word_array);
    });
    
    $("#fm_search select").change(function(){
        vi(p);
    });
    
    $("#tx_search").keypress(function(e){
        if(e.which==13){
            vi(p);
        }
    });
    
    $(".tbl_print thead .sel_all").click(function(){
        var chk=$(this).closest("table").find("tbody input");
        chk.prop("checked",$(this).prop("checked"));//根据全选的checkbox状态来填充单个checkbox状态
    });
    $(".tbl_print thead .sel_info").click(function(){
        var chk=$(this).closest("table").find("tbody input:not([value*='receive'],[value*='pay'])");
        chk.prop("checked",$(this).prop("checked"));//根据全选的checkbox状态来填充单个checkbox状态
    });
    $(".tbl_print thead .sel_receive").click(function(){
        var chk=$(this).closest("table").find("tbody input[value*='receive']");
        chk.prop("checked",$(this).prop("checked"));//根据全选的checkbox状态来填充单个checkbox状态
    });
    $(".tbl_print thead .sel_pay").click(function(){
        var chk=$(this).closest("table").find("tbody input[value*='pay']");
        chk.prop("checked",$(this).prop("checked"));//根据全选的checkbox状态来填充单个checkbox状态
    });
    $(".tbl_print tbody input").click(function(){
        if(!$(this).prop("checked")) $(this).closest("table").find("thead input").prop("checked",false);//如果当前checkbox状态为未选中则全选的checkbox也设置为未选中
    });

  });
</script>
<!--#include file="lib/js-google-analytics.asp"-->
</head>
<%
If Not CheckFlag(session("aaPostFlag"),1) Then Call JumpErrorPage(2)
%>
<body>
<div id="diaglog_print" title="打印查询结果">
  <form id="fm_print" name="fm_print" class="yform full">
    <div class="subcolumns">
        <div class="c80l">
            <div class="type-text">
              <label for="print_title">表格打印的标题</label>
              <input id="print_title" name="print_title" type="text" />
            </div>
        </div>
        <div class="c20r">
            <div class="type-select">
                <label for="print_mode">打印模式</label>
                <select id="print_mode" name="print_mode">
                    <option value="1">按报关单打印</option>
                    <option value="2">按费用打印</option>
                </select>
            </div>
        </div>
    </div>
    <div class="type-select">
        <table class="tbl_print full">
            <thead>
                <tr>
                    <th scope="col" colspan="3" >选择打印列<span style="float:right"><input type="checkbox" class="sel_all" /> 全选 <input type="checkbox" class="sel_info" /> 信息 <input type="checkbox" class="sel_receive" /> 应收 <input type="checkbox" class="sel_pay" /> 应付</span></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <th scope="col">信息</th>
                    <th scope="col">应收</th>
                    <th scope="col">应付</th>
                </tr>
                <tr>
                    <td>
                        <div class="hlist">
                            <ul>
                            <%
                            dKeys=d.Keys()
                            dVals=d.Items()
                            for i=0 to d.Count-1
                                if instr(dKeys(i),"receive")=0 and instr(dKeys(i),"pay")=0 then
                            %>
                                <li><input type="checkbox" name="search_col" value="<%=dKeys(i)%>" /><%=dVals(i)%></li>
                            <%
                                end if
                            next
                            %>
                            </ul>
                        </div>
                    </td>
                    <td>
                        <div class="hlist">
                            <ul>
                            <%
                            for i=0 to d.Count-1
                                if instr(dKeys(i),"receive") then
                            %>
                                <li><input type="checkbox" name="search_col" value="<%=dKeys(i)%>" /><%=dVals(i)%></li>
                            <%
                                end if
                            next
                            %>
                            </ul>
                        </div>
                    </td>
                    <td>
                        <div class="hlist">
                            <ul>
                            <%
                            for i=0 to d.Count-1
                                if instr(dKeys(i),"pay") then
                            %>
                                <li><input type="checkbox" name="search_col" value="<%=dKeys(i)%>" /><%=dVals(i)%></li>
                            <%
                                end if
                            next
                            %>
                            </ul>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
        <%
          Set rs_calc = Server.CreateObject("ADODB.Recordset")
          sql = "SELECT * FROM catecount"
          rs_calc.Open sql,conn,1,1
          aaCate=rs_calc.getrows
          iCate=ubound(aaCate,1)
          rs_calc.close
          sql="select max(num) as row from(select count(feecategory) as num from detail group by feecategory)"
          rs_calc.Open sql,conn,1,1
          iRow=rs_calc("row")
          rs_calc.close
          'sql="select detail.id as detailid,detail.feecategory as cateid,detail.feename as detailname,detail.short as detailshort,iif(isnull(receive),0,receive) as detailreceive,iif(isnull(pay),0,pay) as detailpay,f.id as feeid from (SELECT * FROM fee where cd="
          sql="select id,feecategory,feename,short from detail order by feecategory,id asc"
          
          rs_calc.Open sql,conn,1,1
          aaFee=rs_calc.getrows
          rs_calc.close
          set rs_calc=nothing

        %>
        <table class="tbl_print full">
          <thead>
            <tr>
                <th scope="col" colspan="<%=(iCate+1)*3%>">详细费用列表<span style="float:right"><input type="checkbox" class="sel_all" /> 全选 <input type="checkbox" class="sel_receive" /> 应收 <input type="checkbox" class="sel_pay" /> 应付</span></th>
            </tr>
          </thead>
          <tbody>
            <tr>
            <%
              for i=0 to iCate
            %>
              <th scope="col"><%=aaCate(1,i)%></th>
              <th scope="col">应收</th>
              <%if CheckEmployee() then%>
              <th scope="col">应付</th>
              <%end if%>
            <%
              next
            %>
            </tr>
          <%
            for i=0 to iRow-1
          %>
            <tr>
            <%
              for j=0 to iCate
            %>
              <td>
              <%
                'aaCate(0,j)=1 aaCate(3,j)=5
                if i\aaCate(3,j)>=1 then
                  response.write("")
                else
                  n=0
                  for z=0 to j-1
                    n=n+aaCate(3,z)
                  next
                  n=n+i
                  response.write(aaFee(2,n))
                end if
              %>
              </td>
              <td>
              <%
                'aaCate(0,j)=1 aaCate(3,j)=5
                if i\aaCate(3,j)>=1 then
                  response.write("")
                else
                  'aaFee(2,0)=码头费用
                  n=0
                  for z=0 to j-1
                    n=n+aaCate(3,z)
                  next
                  n=n+i
                  ' if aaFee(4,n)=0 then aaFee4r="" else aaFee4r=aaFee(4,n)
                  response.write("<input type='checkbox' name='search_col' value='detail_"&aaFee(0,n)&"_receive|"&aaFee(2,n)&"(应收)' />")
                end if
              %>
              </td>
              <%if CheckEmployee() then%>
              <td>
              <%
                'aaCate(0,j)=1 aaCate(3,j)=5
                if i\aaCate(3,j)>=1 then
                  response.write("")
                else
                  'aaFee(2,0)=码头费用
                  n=0
                  for z=0 to j-1
                    n=n+aaCate(3,z)
                  next
                  n=n+i
                  ' if aaFee(5,n)=0 then aaFee5p="" else aaFee5p=aaFee(5,n)
                  response.write("<input type='checkbox' name='search_col' value='detail_"&aaFee(0,n)&"_pay|"&aaFee(2,n)&"(应付)' />")
                end if
              %>
              </td>
              <%end if%>
            <%
              next
            %>
            </tr>
          <%
            next
          %>
          </tbody>
        </table>
    </div>
  </form>
</div>
<!--#include file="lib/header.asp"-->
<!--#include file="lib/nav.asp"-->
<div id="main">

<!--#include file="lib/col1.asp"-->
<!--#include file="lib/col2.asp"-->
  <div id="col3" role="main">
    <div id="col3_content" class="clearfix">
      <form id="fm_search" name="fm_search">
        <table id="search_bar" class="full">
          <tr>
            <td id="lb_search"><label for="tx_search">查询内容：</label></td>
            <td>
              <div>
                <input id="tx_search" name="tx_search" type="text" />
                申报日期
                <input name="ksrq" id="ksrq" class="datepicker" type="text" size="10" maxlength="10" readonly="readonly" />-<input name="jsrq" id="jsrq" class="datepicker" type="text" size="10" maxlength="10" readonly="readonly" />
                <select id="cd_check" name="cd_check">
                  <option value="">是否查验</option>
                  <option value="true">已查验</option>
                  <option value="false">未查验</option>
                </select>
                <select id="search_count" name="search_count">
                  <option value="500">最新500条</option>
                  <option value="0">全部</option>
                </select>
                <a id="show_adv" href="#">高级</a>
              </div>
              <div id="adv_search">
                <select id="cd_status" name="cd_status">
                  <option value="0">选择状况</option>
                  <option value="1">未退</option>
                  <option value="2">海关已退</option>
                  <option value="3">已退客户</option>
                </select>
                已退日期
                <input name="ytksrq" id="ytksrq" class="datepicker" type="text" size="10" maxlength="10" disabled="disabled" readonly="readonly" />-<input name="ytjsrq" id="ytjsrq" class="datepicker" type="text" size="10" maxlength="10" disabled="disabled" readonly="readonly" />
                结算日期
                <input name="jsksrq" id="jsksrq" class="datepicker" type="text" size="10" maxlength="10" readonly="readonly" />-<input name="jsjsrq" id="jsjsrq" class="datepicker" type="text" size="10" maxlength="10" readonly="readonly" />
                <select id="cd_confirm" name="cd_confirm">
                  <option value="">是否确认</option>
                  <option value="true">已确认</option>
                  <option value="false">未确认</option>
                </select>
                <select id="cd_received" name="cd_received">
                  <option value="">是否已收</option>
                  <option value="true">已收</option>
                  <option value="false">未收</option>
                </select>
                <%if CheckEmployee() then%>
                <select id="cd_paid" name="cd_paid">
                  <option value="">是否已付</option>
                  <option value="true">已付</option>
                  <option value="false">未付</option>
                </select>
                <select id="show_rp" name="show_rp">
                  <option value="">显示收付</option>
                  <option value="true">只显示收</option>
                  <option value="false">只显示付</option>
                </select>
                <select name="post" id="post">
                  <option value="0">选择岗位</option>
                  <%
                    for i=0 to ubound(session("aaPostFlag"),2)
                      if session("aaPostFlag")(0,i)>0 and session("aaPostFlag")(0,i)<5 then
                  %>
                  <option value="<%=session("aaPostFlag")(0,i)%>"><%=GetPostString(session("aaPostName"),session("aaPostFlag")(0,i))%></option>
                  <%
                      end if
                    next
                  %>
                </select>
                <select id="wtr" name="wtr">
                  <option value="0">选择委托人</option>
                  <%
                    Set rs_wtr = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * FROM wtr where wtrhidden=false order by wtr"
                    rs_wtr.Open sql,conn,1,1
                    do while not rs_wtr.eof
                  %>
                  <option value="<%=rs_wtr("id")%>" <%if rs_wtr("id")=clng(wtr) then response.write("selected='selected'")%>><%=rs_wtr("wtr")%></option>
                  <%
                      rs_wtr.movenext
                    loop
                    rs_wtr.close
                    set rs_wtr=nothing
                  %>
                </select>
                <select name="bwtr" id="bwtr">
                  <option value="0">选择被委托人</option>
                  <%
                    Set rs_bwtr = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * FROM bwtr order by id"
                    rs_bwtr.Open sql,conn,1,1
                    do while not rs_bwtr.eof
                  %>
                  <option value="<%=rs_bwtr("id")%>" <%if rs_bwtr("id")=clng(bwtr) then response.write("selected='selected'")%>><%=rs_bwtr("bwtr")%></option>
                  <%
                      rs_bwtr.movenext
                    loop
                    rs_bwtr.close
                    set rs_bwtr=nothing
                  %>
                </select>
                <%end if%>
                <select name="dept" id="dept">
                  <option value="0">选择组</option>
                  <%
                    Set rs_dept = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * FROM dept order by id"
                    rs_dept.Open sql,conn,1,1
                    do while not rs_dept.eof
                  %>
                  <option value="<%=rs_dept("id")%>" <%if rs_dept("id")=clng(dept) then response.write("selected='selected'")%>><%=rs_dept("dept")%></option>
                  <%
                      rs_dept.movenext
                    loop
                    rs_dept.close
                    set rs_dept=nothing
                  %>
                </select>
                <select name="ic" id="ic">
                  <option value="">选择发送报关卡</option>
                  <%
                    Set rs_ic = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * FROM bwtric order by ic_code"
                    rs_ic.Open sql,conn,1,1
                    do while not rs_ic.eof
                  %>
                  <option value="<%=rs_ic("ic_code")%>" <%if rs_ic("ic_code")=clng(ic_code) then response.write("selected='selected'")%>><%=rs_ic("ic_code")%></option>
                  <%
                      rs_ic.movenext
                    loop
                    rs_ic.close
                    set rs_ic=nothing
                  %>
                </select>
                <select name="input_ic" id="input_ic">
                  <option value="">选择输入报关卡</option>
                  <%
                    Set rs_ic = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * FROM bwtric order by ic_code"
                    rs_ic.Open sql,conn,1,1
                    do while not rs_ic.eof
                  %>
                  <option value="<%=rs_ic("ic_code")%>"><%=rs_ic("ic_code")%></option>
                  <%
                      rs_ic.movenext
                    loop
                    rs_ic.close
                    set rs_ic=nothing
                  %>
                </select>
                <select name="category" id="category">
                  <option value="0">选择类型</option>
                  <%
                    Set rs_category = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * FROM category order by id"
                    rs_category.Open sql,conn,1,1
                    do while not rs_category.eof
                  %>
                  <option value="<%=rs_category("id")%>" <%if rs_category("id")=clng(category) then response.write("selected='selected'")%>><%=rs_category("category")%></option>
                  <%
                      rs_category.movenext
                    loop
                    rs_category.close
                    set rs_category=nothing
                  %>
                </select>
                <select id="detail" name="detail">
                  <option value="0">选择详细费用</option>
                  <%
                    Set rs_detail = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * FROM FEECATEGORY order by id"
                    rs_detail.Open sql,conn,1,1
                    do while not rs_detail.eof
                  %>
                  <option value="<%=rs_detail("id")%>">有<%=rs_detail("FEECATEGORY")%>费用</option>
                  <%
                      rs_detail.movenext
                    loop
                    rs_detail.close
                    set rs_detail=nothing
                  %>
                </select>
                <select id="passno" name="passno">
                  <option value="">是否有通关单</option>
                  <option value="true">有通关单</option>
                  <option value="false">无通关单</option>
                </select>
                <select id="orderno" name="orderno">
                  <option value="">是否有合同号</option>
                  <option value="true">有合同号</option>
                  <option value="false">无合同号</option>
                </select>
                <select id="fee" name="fee">
                  <option value="">是否有额外费用</option>
                  <option value="true">有额外费用</option>
                  <option value="false">无额外费用</option>
                </select>
                <select id="cd_synmode" name="cd_synmode">
                  <option value="0">选择同步方式</option>
                  <option value="1">系统</option>
                  <option value="2">手工</option>
                </select>
                <select id="cd_source" name="cd_source">
                  <option value="0">选择单源类型</option>
                  <%
                    Set rs_source = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * FROM cdsource order by id"
                    rs_source.Open sql,conn,1,1
                    do while not rs_source.eof
                  %>
                  <option value="<%=rs_source("id")%>"><%=rs_source("source")%></option>
                  <%
                      rs_source.movenext
                    loop
                    rs_source.close
                    set rs_source=nothing
                  %>
                </select>
                <select id="duplicate" name="duplicate">
                  <option value="">是否报关单号重复</option>
                  <option value="true">有报关单号重复</option>
                  <option value="false">无报关单号重复</option>
                </select>
                <select id="cd_hidden" name="cd_hidden">
                  <option value="false">只显示不隐藏的报关单</option>
                  <option value="">显示全部报关单</option>
                  <option value="true">只显示隐藏的报关单</option>
                </select>
                <select id="edoc" name="edoc">
                  <option value="">是否有随附单据</option>
                  <option value="true">有随附单据</option>
                  <option value="false">无随附单据</option>
                </select>
                <select id="roleid" name="roleid">
                  <option value="0">选择角色</option>
                  <%
                    Set rs_role = Server.CreateObject("ADODB.Recordset")
                    sql = "select * from role where id in (SELECT roleid FROM cdroleuser group by roleid)"
                    rs_role.Open sql,conn,1,1
                    do while not rs_role.eof
                  %>
                  <option value="<%=rs_role("id")%>"><%=rs_role("rolename")%></option>
                  <%
                      rs_role.movenext
                    loop
                    rs_role.close
                    set rs_role=nothing
                  %>
                </select>
                <select id="userid" name="userid">
                  <option value="0">选择角色用户</option>
                  <%
                    Set rs_user = Server.CreateObject("ADODB.Recordset")
                    sql = "select id,fullname from username where id in (SELECT userid FROM cdroleuser group by userid) order by fullname asc"
                    rs_user.Open sql,conn,1,1
                    do while not rs_user.eof
                  %>
                  <option value="<%=rs_user("id")%>"><%=rs_user("fullname")%></option>
                  <%
                      rs_user.movenext
                    loop
                    rs_user.close
                    set rs_user=nothing
                  %>
                </select>
                <select id="entry_type" name="entry_type">
                  <option value="">选择报关单类型</option>
                  <%
                    Set rs_entry_type = Server.CreateObject("ADODB.Recordset")
                    sql = "select entry_type,entry_name from entry_type"
                    rs_entry_type.Open sql,conn,1,1
                    do while not rs_entry_type.eof
                  %>
                  <option value="<%=rs_entry_type("entry_type")%>"><%=rs_entry_type("entry_name")%></option>
                  <%
                      rs_entry_type.movenext
                    loop
                    rs_entry_type.close
                    set rs_entry_type=nothing
                  %>
                </select>
              </div>
            </td>
            <td id="bts_search">
              <div class="ui-widget">
              <input id="bt_search" class="bt_button" name="bt_submit" type="button" value="搜索" />
              <input class="bt_button" type="reset" value="重置" />
              </div>
            </td>
          </tr>
        </table>
      </form>
      <div id="search_main">
      <!--
      <div id="example" style="height: 350px;"></div>
      -->
        <div id="tags"></div>
      </div>
    </div>
  </div>
</div>
<!--#include file="lib/footer.asp"-->
</body>
</html>
<!--#include file="lib/connclose.asp"-->

